import request from '@/utils/request'

export function add(params) {
    return request({
        url: '/article/add',
        method: 'POST',
        data: params
    }).then(res => {
        return res
    })
}
export function getList(params = {}) {
    return request({
        url: '/article/list',
        method: 'POST',
        data: params
    }).then(({ records }) => {
        return records
    })
}
export function delItem(params) {
    return request({
        url: '/article/delete',
        method: 'POST',
        data: params
    }).then(res => res)
}
export function getDetail(params) {
    return request({
        url: '/article/detail',
        method: 'POST',
        data: params
    }).then((data) => data)
}
export function update(params) {
    return request({
        url: '/article/edit',
        method: 'POST',
        data: params
    }).then(res => res)
}
export function toggleBanner(params) {
    return request({
        url: '/banner/updateStatus',
        method: 'POST',
        data: params
    }).then(res => res)
}